<script>
	import store from './store'
	export default {
		onLaunch: function() {
			console.log('App Launch')
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		methods:{
			setWxHeader(){
				let statusBarHeight = uni.getWindowInfo().statusBarHeight;
				// #ifdef MP 
				let menuButtonHeight = uni.getMenuButtonBoundingClientRect().height;
				let titleBarWidth = uni.getWindowInfo().windowWidth - uni.getMenuButtonBoundingClientRect().width - (uni.getWindowInfo().windowWidth - uni.getMenuButtonBoundingClientRect().right) * 2;
				let titleBarHeight = (uni.getMenuButtonBoundingClientRect().top - statusBarHeight) * 2 + menuButtonHeight;
				store.commit('setWxHeader',{
					'statusBarHeight':statusBarHeight,
					'menuButtonHeight':menuButtonHeight,
					'titleBarWidth':titleBarWidth,
					'titleBarHeight':titleBarHeight
				})
				// #endif
				// #ifdef APP
				store.commit('setStatusBarHeight',statusBarHeight)
				// #endif
			},
		},
	}
</script>

<style>
	/*每个页面公共css */
</style>
